/*************************************************************************
*																		 *
*				code by Miles Chen (v-mich) 2007.9.3					 *
*																		 *
*																		 *
*************************************************************************/

#pragma once


class CMainForm :
	public CDialogAppBase,
	public CSalary
{
public:

	CMainForm()
	{
		m_iFormID = IDD_FORM;
		m_hIcon = LoadIconW(m_hInst, MAKEINTRESOURCEW(IDI_APP));
	}

	~CMainForm(void)
	{
	}

private:

	void OnInitDialog(HWND hDlg)
	{
		CDialogAppBase::OnInitDialog(hDlg);

		// Add additional code here
		SendMessageW(hDlg, WM_SETICON, ICON_SMALL, (WPARAM)m_hIcon);
		SetWindowTopMost(hDlg);

		//
		InitSalaryEditControls(hDlg);
		InitTax(hDlg);

		//set city found
		SendDlgItemMessageW(hDlg, IDC_COMPANY_CITY, BM_SETCHECK, BST_CHECKED, 0);
		SetCityFound(hDlg);
	}

	void OnCommand(HWND hDlg, WORD wmID, WORD wmEvent, LPARAM lParam)
	{
		// Add additional code here
		switch(wmID)
		{
		case IDC_CALC:
			{	
				Calc(hDlg);
			}
			break;
		case IDC_RESET:
			{	
				Reset(hDlg);
			}
			break;
		case IDC_ABOUT:
			{	
				ShellAboutW(hDlg, L"Calculator 2009", L"Miles Chen (Wicresoft) - -|||", m_hIcon);
			}
			break;
		case IDC_COMPANY_CITY:
			{	
				if(BST_CHECKED == SendDlgItemMessageW(hDlg, IDC_COMPANY_CITY, BM_GETCHECK, 0, 0))
					SetCityFound(hDlg);
			}
			break;
		case IDC_COMPANY_TOWN:
			{
				if(BST_CHECKED == SendDlgItemMessageW(hDlg, IDC_COMPANY_TOWN, BM_GETCHECK, 0, 0))
					SetTownFound(hDlg);
			}
			break;
		default:
			break;
		}
	}

	void OnLeftMouseButtonDown(HWND hDlg, LPARAM lParam)
	{
		// Add additional code here
	}

	void OnCommandOK(HWND hDlg)
	{
		// Add additional code here
	}

	void OnCommandCancel(HWND hDlg)
	{
		// Add additional code here
	}
};
